<template>
  <div class="box-card">
    <el-card shadow="hover" @click="goDetail">
      <div class="content">
        <div class="left">
          <div class="hospital_name">
            {{hospitalInfo.hosname}}
          </div>
          <div class="hospital_tip">
            <div class="hospital_level">
              <el-icon><Pointer/></el-icon>
              <span>{{ hospitalInfo.param.hostypeString }}</span>
            </div>
            <div class="hospital_time">
              <el-icon><Clock/></el-icon>
              <span>每天{{hospitalInfo.bookingRule?.releaseTime}}放号</span>
            </div>
          </div>
        </div>
        <div class="right">
          <img :src="`data:image/jpeg;base64,${hospitalInfo?.logoData}`"  alt=""/>
        </div>
      </div>
    </el-card>
  </div>
</template>
<script setup lang="ts">
import {PropType, ref} from 'vue'
import {Clock,Pointer} from '@element-plus/icons-vue'
import {Hospital} from "@/api/home/type.ts";
import {useRouter} from "vue-router";
const $router = useRouter()
const {hospitalInfo} = defineProps({
  hospitalInfo:{
    type:Object as PropType<Hospital>
  }
})
const goDetail = () => {

  $router.push({
    path:'/hospital/register',
    query:{
      hoscode:hospitalInfo.hoscode
    }
  })
}
</script>

<style scoped lang="scss">
.content{
  display: flex;
  justify-content: space-between;
  .left{
    width: 70%;
    display: flex;
    flex-direction: column;
    .hospital_tip{
      display: flex;
      justify-content: space-between;
      margin-top: 20px;
      .hospital_level, .hospital_time{
        display: flex;
        align-items: center;
        span{
          margin-left: 5px;
        }
      }
    }
  }
  .right{
    img{
      width: 80px;
      height: 80px;
      clip-path: circle(50%);
    }
  }
}
</style>
